<script lang="ts">
export default {
  name: 'Dialog',
}
</script>

<script setup lang="ts">
const prop = defineProps(['diag',"title",'width'])
const emit = defineEmits(['submit',"update:diag"])
const width =  prop.width != null ? prop.width : "25%"
function Submit() {
  emit("submit");
  handleClose()
}

function handleClose() {
  emit("update:diag", false);
}

</script>


<template>
  <el-dialog v-model="prop.diag"  :before-close="handleClose" :width="width" lock-scroll destroy-on-close >
    <template #header>
      <span style="font-size: 18px;font-family: 微软雅黑;font-weight: bold;color: #3d546f">{{prop.title}}</span>
    </template>
    <slot></slot>

    <template #footer>
      <el-button @click="handleClose" type="info">取消</el-button>
      <el-button @click="Submit" type="warning">确认</el-button>
    </template>
  </el-dialog>
</template>


<style scoped>

</style>